package com.treasure.mall.biz.service.core.marketing;

import com.treasure.mall.biz.base.SearchableCrudService;
import com.treasure.mall.biz.entity.marketing.UserSignInPO;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.util.List;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/8/22
 */
public interface UserSignInService extends SearchableCrudService<UserSignInPO, Long> {
    /**
     * 签到
     *
     * @param userId
     * @return
     */
    @Transactional
    UserSignInPO signIn(Long userId);

    /**
     * 签到记录，前三后三
     *
     * @param userId
     * @return
     */
    List<UserSignInPO> logs(Long userId);

    UserSignInPO findByDate(Long userId, LocalDate date);

    UserSignInPO findLast(Long userId);
}
